class Transition:

    def __init__(self, name, source, target, conditions=None, machine=None):
        self.name = name
        self.source = source
        self.target = target
        self.conditions = conditions
        if self.conditions is None:
            self.conditions = []
        self.machine = machine

    def add_condition(self, condition):
        condition.machine = self.machine
        self.conditions.append(condition)

    def add_conditions(self, conditions):
        for condition in conditions:
            self.add_condition(condition)
